import { Button, Tooltip } from 'antd';
import React from 'react';

type buttonProps = React.Component<typeof Button>;

interface propsType extends Omit<buttonProps, 'desc' | 'tipTitle', 'isTip'> {
  desc: string; //按钮文字
  tipTitle: 'string';
  isTip: boolean; //是否展示提示文案
}

function ButtonTip(props: propsType) {
  if (props.isTip) {
    return (
      <Tooltip title={props.tipTitle}>
        <Button {...props}>{props.desc}</Button>
      </Tooltip>
    );
  }
  return <Button {...props}>{props.desc}</Button>;
}

export default ButtonTip;
